package com.jonluo.model;

import com.jonluo.utils.DateUtils;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * @author jonluo
 * Date 2017/9/15
 */
public class SysUser implements Serializable {
    /**
    * id
    */
    private String userId;

    /**
    * 用户名
    */
    @NotBlank(message="用户名不能为空")
    private String username;

    /**
    * 密码
    */
    @NotBlank(message="密码不能为空")
    private String password;

    /**
    * 盐
    */
    private String salt;

    /**
    * 邮箱
    */
    @NotBlank(message="邮箱不能为空")
    @Email(message="邮箱格式不正确")
    private String email;

    /**
    * 手机号
    */
    private String mobile;

    /**
    * 状态  0：禁用   1：正常
    */
    private Byte status;

    /**
    * 部门ID
    */
    private String deptId;

    /**
    * 创建时间
    */
    private Date createTime;

    /**
     * 部门名称
     */
    private String deptName;
    /**
     * 角色ID列表
     */
    private List<String> roleIdList;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getCreateTime() {
        return  DateUtils.format(createTime,DateUtils.DATE_TIME_PATTERN);
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public List<String> getRoleIdList() {
        return roleIdList;
    }

    public void setRoleIdList(List<String> roleIdList) {
        this.roleIdList = roleIdList;
    }
}